/**
 * 
 */
package com.cqan.digital.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.cqan.entity.pk.LongEntity;

/**
 * @Description TODO
 * @author slaton.wu@gmail.com
 * @date 2012-7-5下午3:20:30
 *
 */
@Entity
//表名与类名不相同时重新定义表名.
@Table(name = "TBL_DIGITAL")
//默认的缓存策略.
@SuppressWarnings("serial")
@XmlRootElement(name="digital")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Digital extends LongEntity {

	private Date createTime;
	
	private String description;
	
	/**
	 * 节点类型 0：栏目 1：数据
	 */
	private Integer digitalType;
	
	/**
	 * 积分
	 */
	private int integral;
	
	private String logo;
	
	private long pid;
	
	private boolean status;
	
	//正文
	private String textContent;
	
	
	private String title;

	
	@Column(name="CREATE_TIME")
	public Date getCreateTime() {
		return createTime;
	}


	@Column(name="DESCRIPTION")
	public String getDescription() {
		return description;
	}


	@Column(name="DIGITAL_TYPE")
	public Integer getDigitalType() {
		return digitalType;
	}


	@Column(name="INTEGRAL")
	public int getIntegral() {
		return integral;
	}


	@Column(name="LOGO")
	public String getLogo() {
		return logo;
	}


	@Column(name="PID")
	public long getPid() {
		return pid;
	}


	@Column(name="TEXT_CONTENT",length=2000)
	public String getTextContent() {
		return textContent;
	}


	@Column(name="TITLE",length=500)
	public String getTitle() {
		return title;
	}


	@Column(name="STATUS")
	public boolean isStatus() {
		return status;
	}

	
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	
	public void setDigitalType(Integer digitalType) {
		this.digitalType = digitalType;
	}

	public void setIntegral(int integral) {
		this.integral = integral;
	}

	public void setLogo(String logo) {
		this.logo = logo;
	}

	public void setPid(long pid) {
		this.pid = pid;
	}

	public void setStatus(boolean status) {
		this.status = status;
	}


	public void setTextContent(String textContent) {
		this.textContent = textContent;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	
	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}
}
